# -*- coding = utf-8 -*-
# @Time      : 2020/10/14 22:18
# @Author    : Reanon
# @File      : testXwlt.py
# @Email     : dafo360@gmail.com
# @Software  : PyCharm

import xlwt  # 导入模块

# 将九九乘法表显示在表格中，每个单元格1个公式

# 创建workbook 对象
workbook = xlwt.Workbook(encoding='utf-8')
# 创建工作表sheet
worksheet = workbook.add_sheet('sheet1')
# # 往表中写内容,第一个参数行,第二个参数列,第三个参数内容
# worksheet.write(0, 0, 'hello')

for i in range(0, 9):
    for j in range(0, i + 1):
        worksheet.write(i, j, "%d * %d = %d" % (i + 1, j + 1, (i + 1) * (j + 1)))
# 保存表为students.xls
workbook.save('../data/students.xls')
